package com.woniuxy.service.impl;

import com.woniuxy.entity.HealthInfo;
import com.woniuxy.mapper.HealthInfoMapper;
import com.woniuxy.service.HealthInfoService;
import com.woniuxy.util.ResponseEnum;
import com.woniuxy.util.ResponseUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 健康信息服务实现类
 * 实现健康信息相关的业务操作
 */
@Service
public class HealthInfoServiceImpl implements HealthInfoService {
    @Resource
    private HealthInfoMapper healthInfoMapper;;
    
    /**
     * 根据居民ID查询健康信息
     * @param residentId 居民ID
     * @return 返回指定居民ID的健康信息的响应结果
     */
    @Override
    public ResponseUtil queryByResidentId(Integer residentId) {
        HealthInfo healthInfo = healthInfoMapper.queryByResidentId(residentId);
        return ResponseUtil.get(ResponseEnum.OK,healthInfo);
    }
}
